import { status } from '@/utils/enums'

/** 表单 */
export const formData = {
  name: '',
  phone: '',
  daterange: ''
}
export const formConfig = [
  {
    type: 'input',
    prop: 'name',
    label: '用户名称'
  },
  {
    type: 'input',
    prop: 'phone',
    label: '手机号码',
    formatter: (value) => value.replace(/[^\d]/g, '')
  },
  {
    type: 'select',
    prop: 'select',
    label: '下拉框',
    isEnum: true,
    options: status
  },
  {
    type: 'date',
    prop: 'daterange',
    kind: 'daterange',
    label: '创建时间'
  }
]
/** 表格 */
export const tableColumns = [
  {
    label: '商行名称',
    prop: 'name'
  },
  {
    label: '用户昵称',
    prop: 'nickname'
  },
  {
    label: '经理/客服名称',
    prop: 'managename'
  },
  {
    label: '手机号码',
    prop: 'phone'
  },
  {
    label: '会员到期时间',
    prop: 'endtime'
  },
  {
    label: '客户已注册未办理过会员天数',
    prop: 'novipDay'
  },
  {
    label: '客户会员过期天数',
    prop: 'expirationDay'
  },
  {
    label: '状态',
    prop: 'status',
    filter: (val) => status[val]
  },
  {
    label: '总订单记录金额',
    prop: 'orderMoney'
  },
  {
    label: '客户转介绍人数',
    prop: 'numpeople'
  },
  {
    label: '注册时间',
    prop: 'signdate'
  },
  {
    label: '创建时间',
    prop: 'date'
  },
  {
    label: '客户地址',
    prop: 'address'
  },
  {
    label: '操作',
    prop: 'operation',
    slotName: 'operation'
  }
]
export const tableData = [
  {
    id: 1,
    name: 'zhangsan',
    nickname: '张三',
    managename: '销售1',
    phone: '15600000000',
    status: 1,
    date: '2023-05-31',
    endtime: '2023-05-30',
    signdate: '2023-05-30',
    orderMoney: '22222',
    numpeople: '12',
    expirationDay: '5',
    novipDay: '1',
    address: '杭州勾庄'
  },
  {
    id: 2,
    name: 'lisi',
    nickname: '李四',
    managename: '销售1',
    phone: '15600000001',
    status: 2,
    date: '2023-05-31',
    endtime: '2023-05-30',
    signdate: '2023-05-30',
    orderMoney: '22222',
    numpeople: '23',
    expirationDay: '5',
    novipDay: '1',
    address: '杭州勾庄'
  },
  {
    id: 3,
    name: 'wangwu',
    managename: '销售1',
    nickname: '王五',
    phone: '15600000002',
    status: 2,
    date: '2023-05-30',
    endtime: '2023-05-30',
    signdate: '2023-05-30',
    orderMoney: '22222',
    numpeople: '2',
    expirationDay: '5',
    novipDay: '1',
    address: '信阳大别山'
  }
]
